<html>

<head>
    @include('WShop::public.head')
</head>

<body style="background: url({{asset(config('view.frontend.wap_login').'/images/2.png')}}) no-repeat;background-size: 100% 100%;margin-top: 44px;">
<header class="mui-bar mui-bar-nav  index-header" style="background: transparent;">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left mui-text-bai" href='javascript:;' onclick="javascript:window.history.back();return false;"></a>
    <h1 class="mui-title mui-text-bai">分享码</h1>

</header>

<div class="mui-content mui-scroll-wrapper" id="pullrefresh" style="background: transparent;" >
    <div class="mui-scroll">

        <div class="mui-table-view mui-table-view-chevron" >

            <div class="mui-yaoqing-header">
                <h4>扫码有惊喜</h4>
                {{--<h4>扫码下载APP立即领好礼</h4>--}}
                <div class="mui-yaoqing-phone">
                    <h5>我的邀请码</h5>
                    <input value="{{$info->referrer_code}}" id="banknumber" style="width: 80%" />

                    <img src="{{$code_url}}" alt=""  />
                    <div class="zhantie mui-text-center">
                        <button type="button" class="mui-btn receive_3_btn" data-clipboard-target="#banknumber" >邀请好友</button>
                    </div>
                    <p class='font-13'>注册成功后尽快联系邀请人激活，激活成功后可前往商城购物消费啦</p>
                </div>


            </div>

        </div>

    </div>
</div>

<img src="{{asset(config('view.frontend.wap_login').'/images/1.png')}}" class="mui-bgs">

@include('WShop::public.scripts')
<script src="{{asset(config('view.frontend.wap_login').'/js/copy.js')}}"></script>
<script src="{{asset(config('view.frontend.wap_login').'/js/api.js')}}"></script>
<script type="text/javascript" charset="utf-8">
    apiready = function(){
        var clipBoard = api.require('clipBoard');
        $api.addEvt('.receive_3_btn', 'click', function(){
            var pFocusa = document.getElementById("banknumber").value;
            clipBoard.set({
                value: pFocusa
            }, function(ret, err) {
                if (ret) {
                    mui.toast(JSON.stringify(ret));
                } else {
                    mui.toast(JSON.stringify(err));
                }
            });
        });
    }


    var clipboard = new ClipboardJS('.receive_3_btn');

    clipboard.on('success', function(e) {
        mui.toast('复制成功')
    });

    clipboard.on('error', function(e) {
        var pFocus = document.getElementById("banknumber");
        pFocus.focus();
        pFocus.select();
        mui.toast('复制失败，请长按复制')
    });
</script>

</body>

</html>